package org.zn.mvcbase.utils;

import javax.servlet.http.HttpSession;

import org.zn.mvcbase.session.SynSessions;

/**
* 
* @Company OBOR
* @Author 周楠
* @Description
* 2018年11月6日
*
*/
public class WhSchemaUtils {
	
	private  static ThreadLocal<String> userDataBase=new ThreadLocal<>();
	
	//private static final String schemaRegion="wh_ins_";
	
	
	public  static void setSchema(HttpSession session,String region) {
		
		SynSessions ss=SynSessions.getSynSessions(session);
		
		String sc=ss.getSynSessionRegionValue(region, "schema").toString();
		
	//	userDataBase.set();
	//	String sc=  session.getAttribute(RegionConstant.Region+"."+RegionConstant.UserDataBase).toString();
	
		userDataBase.set(sc);
		
	}
	
	public  static void setSchema(String schema) {
		
		userDataBase.set(schema);
		
	}
	
	
	public static String getSchema() {
		
		return  userDataBase.get();

	}
	

}
